#ifndef SCENE_H_INCLUDED
#define SCENE_H_INCLUDED

#include <SDL/SDL.h>
#include "common/be_scene.h"
#include "common/be_frame_limiter.h"
#include "entities/world.h"
#include "utils/sc_settings_loader.h"

class Scene : public BeScene {

	public:
		Scene(int argc, char* argv[]);
		virtual ~Scene();

		boost::scoped_ptr<World> world;

		void draw();

		// car movement
		void car_steering( float value );
		void car_throttle( float value );
		void car_braking( float value );

		void canvas_setx( float value );
		void canvas_sety( float value );
		void canvas_press();
		void canvas_release();
		void canvas_swapchild(const string& child);

		void steerleft();
		void steerright();
		void accelforw();
		void accelback();
		void handbrake();
		void steerleft_rel();
		void steerright_rel();
		void accelforw_rel();
		void accelback_rel();
		void handbrake_rel();
		void player_join();
		void player_unjoin();

		// car settings
		void carsetting_suspensionstiffness_inc();
		void carsetting_suspensionstiffness_dec();
		void carsetting_suspensiondamping_inc();
		void carsetting_suspensiondamping_dec();
		void carsetting_suspensioncompression_inc();
		void carsetting_suspensioncompression_dec();
		void carsetting_rollinfluence_inc();
		void carsetting_rollinfluence_dec();
		void carsetting_suspensionrestlength_inc();
		void carsetting_suspensionrestlength_dec();
		void carsetting_steeringincrement_inc();
		void carsetting_steeringincrement_dec();
		void carsetting_steeringclamp_inc();
		void carsetting_steeringclamp_dec();
		void carsetting_exponentialsteering_inc();
		void carsetting_exponentialsteering_dec();

		// input commands
		void joystick_toggle();

		//camera
		void camera_moveup();
		void camera_movedown();
		void camera_moveforward();
		void camera_movebackward();
		void camera_moveleft();
		void camera_moveright();
		void camera_lookup();
		void camera_lookdown();
		void camera_lookleft();
		void camera_lookright();
		void camera_rollleft();
		void camera_rollright();
			
		// race control
		void race_start();

	private:
		Settings *settings;
		float timeDelta;
		long long	frameCounter;

		BeFrameLimiter framelimiter;
		
		// COMMANDS
		const unsigned int* client;
		const unsigned int* drawdebug;
		const unsigned int* headless;

		float m_cameraTranslateSpeed;
		float m_cameraRotateSpeed;

		ScSettingsLoader m_settingsLoader;
};

#endif
